﻿using System;
using UnityEngine;

namespace Zero.Dialogue
{
    public class BubbleCharacter : MonoBehaviour
    {
        [Tooltip("角色名")]
        public string characterName;
        [Tooltip("角色名的轮廓颜色")]
        public Color outlineColor = Color.black;
        [Tooltip("气泡位置偏移")]
        public Vector3 bubbleOffset = Vector3.up;

        /// <summary>
        /// 显示自定义气泡
        /// </summary>
        /// <param name="body">主体内容</param>
        public void ShowBubbleCustom(string body)
        {
            DialogueSystem.Instance.ShowBubble(this, body);
        }


        /// <summary>
        /// 显示自定义气泡
        /// </summary>
        /// <param name="body">主体内容</param>
        /// <param name="duration">持续时间</param>
        public void ShowBubbleCustom(string body, float duration)
        {
            DialogueSystem.Instance.ShowBubble(this, body, duration);
        }


        /// <summary>
        /// 隐藏聊天气泡
        /// </summary>
        public void HideBubble()
        {
            DialogueSystem.Instance.HideBubble(this);
        }


        /// <summary>
        /// 聊天气泡是否显示中
        /// </summary>
        /// <returns></returns>
        public bool IsBubbleShow()
        {
            return DialogueSystem.Instance.IsBubbleShow(this);
        }
    }
}